#include "Color3f.h"

Color3f::Color3f() {
    //Nothing.
}

Color3f::Color3f(float r, float g, float b) {
    this->r = r;
    this->g = g;
    this->b = b;
}

void Color3f::operator+=(const Color3f& v) {
    r += v.r;
    g += v.g;
    b += v.b;
}

Color3f Color3f::operator*(const Color3f& v) const {
    return Color3f(r * v.r, g * v.g, b * v.b);
}

Color3f operator*(const Color3f& v, float f) {
    return Color3f(v.r * f, v.g * f, v.b * f);
}

Color3f operator*(float f, const Color3f& v) {
    return Color3f(v.r * f, v.g * f, v.b * f);
}

ostream& operator<<(ostream& os, Color3f& c) {
    os << c.r << " " << c.g << " " << c.b;
    return os;
}

istream& operator>>(istream& is, Color3f& c) {
    is >> c.r >> c.g >> c.b;
    return is;
}
